<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			// 1. 创建数组
			var arr1 = new Array();
			console.log(arr1.length);
			arr1[0] = "张三";
			arr1[1] = "李四";
			arr1[2] = "王五";
			console.log(arr1.length);

			var arr2 = new Array(5);
			console.log(arr2.length);
			console.log(arr2[0]); // undefined

			var arr3 = new Array(10, 20, 30);
			console.log(arr3.length);
			console.log(arr3[0]);

			var arr4 = [10, 20, 30, 40];
			console.log(arr4.length);
			console.log(arr4[0]);

			var arr5 = [{
					id: 1,
					name: "张三",
					age: 18
				},
				{
					id: 2,
					name: "张三",
					age: 18
				},
				{
					id: 3,
					name: "张三",
					age: 18
				},
			]

			var stu = {
				name: "张三",
				friends: ["李四", "王五", "赵六"]
			}
		</script>
	</body>
</html>
